<?php
//index
$app->get('/', '\DesktopController:index')->setName('Index')->add('\CrmMiddleware:isStaff');

//desktop
$app->get('/login', '\DesktopController:loginpage')->setName('Loginpage');
$app->post('/login', '\DesktopController:login')->setName('Login');
$app->get('/logout', '\DesktopController:logout')->setName('Logout');

//customs
$app->get('/customs[/{from:[+0-9]}[/{p:[0-9]+}]]', '\MemberController:index')->setName('customsIndex')->add('\CrmMiddleware:isStaff');
$app->get('/customs/report[/{year:[0-9]+}]', '\MemberController:report')->setName('customsReport')->add('\CrmMiddleware:isStaff');
$app->get('/customs/detail/{id:[0-9]+}', '\MemberController:detail')->setName('customsDetail')->add('\CrmMiddleware:isStaff');
$app->get('/customs/detail/{id:[0-9]+}/candc', '\MemberController:detailCandc')->setName('customsDetail')->add('\CrmMiddleware:isStaff');
$app->get('/customs/detail/{id:[0-9]+}/msg', '\MemberController:detailMsg')->setName('customsDetail')->add('\CrmMiddleware:isStaff');

$app->post('/customs/close/{id:[0-9]+}', '\MemberController:close')->setName('customsClose')->add('\CrmMiddleware:isStaff');

$app->get('/customs/form[/{id:[0-9]+}]', '\MemberController:form')->setName('customsForm')->add('\CrmMiddleware:isStaff');
$app->post('/customs/save[/{id:[0-9]+}]', '\MemberController:save')->setName('customsSaveform')->add('\CrmMiddleware:isStaff');

$app->get('/customs/search', '\MemberController:searchform')->setName('customsSearchform')->add('\CrmMiddleware:isStaff');
$app->post('/customs/search', '\MemberController:searchresult')->setName('customsSearchresult')->add('\CrmMiddleware:isStaff');
$app->post('/customs/searchJSON', '\MemberController:searchresultJSON')->setName('customsSearchresultJSON')->add('\CrmMiddleware:isStaff');

//vmobile vmobile
$app->post('/vmobile', '\MemberController:vmobile')->add('\CrmMiddleware:isStaff');

//company
$app->get('/companies[/{p:[0-9]+}]', '\CompanyController:index')->setName('companiesIndex')->add('\CrmMiddleware:isStaff');
$app->get('/companies/30daykeyend', '\CompanyController:keyend')->setName('companiesIndexKeyend')->add('\CrmMiddleware:isStaff');
$app->get('/companies/30dayvpdnend', '\CompanyController:vpdnend')->setName('companiesIndexVpdnend')->add('\CrmMiddleware:isStaff');
$app->get('/companies/yearcheck', '\CompanyController:yearcheck')->setName('companiesIndexYearcheck')->add('\CrmMiddleware:isStaff');

$app->get('/companies/detail/{id:[0-9]+}', '\CompanyController:detail')->setName('companiesDetail')->add('\CrmMiddleware:isStaff');
$app->get('/companies/detail/{id:[0-9]+}/contracts', '\CompanyController:detailcontracts')->setName('companiesDetailContracts')->add('\CrmMiddleware:isStaff');
$app->get('/companies/search', '\CompanyController:searchform')->setName('companiesSearchform')->add('\CrmMiddleware:isStaff');
$app->post('/companies/search', '\CompanyController:searchresult')->setName('companiesSearchresult')->add('\CrmMiddleware:isStaff');
$app->get('/companies/report[/{year:[0-9]+}]', '\CompanyController:report')->setName('companiesReport')->add('\CrmMiddleware:isStaff');

$app->get('/companies/form[/{id:[0-9]+}]', '\CompanyController:form')->setName('companiesForm')->add('\CrmMiddleware:isStaff');
$app->post('/companies/save[/{id:[0-9]+}]', '\CompanyController:save')->setName('companiesSaveform')->add('\CrmMiddleware:isStaff');

//contracts
$app->get('/contracts[/{s:[0-9]+}[/{p:[0-9]+}]]', '\ContractController:index')->setName('contractsIndex')->add('\CrmMiddleware:isStaff');
$app->get('/contracts/detail/{id:[0-9]+}', '\ContractController:detail')->setName('contractsDetail')->add('\CrmMiddleware:isStaff');

//hr
$app->get('/hr[/{s:[0-9]+}[/{subc:[0-9]+}[/{p:[0-9]+}]]]', '\HrController:index')->setName('hrIndex')->add('\CrmMiddleware:isStaff');
$app->get('/hr/detail/{id:[0-9]+}', '\HrController:detail')->setName('hrDetail')->add('\CrmMiddleware:isStaff');
$app->get('/hr/detail/{id:[0-9]+}/authority', '\HrController:authority')->setName('hrDetailAuthority')->add('\CrmMiddleware:isStaff');
$app->post('/hr/detail/{id:[0-9]+}/authority', '\HrController:saveAuthority')->add('\CrmMiddleware:isStaff');
$app->get('/hr/detail/{id:[0-9]+}/remuneration', '\HrController:remuneration')->setName('hrDetailRemuneration')->add('\CrmMiddleware:isStaff');
$app->post('/hr/detail/{id:[0-9]+}/remuneration', '\HrController:saveremuneration')->add('\CrmMiddleware:isStaff');
$app->get('/hr/remunerationlog[/{subc:[0-9]+}[/{month:[0-9]+}[/{p:[0-9]+}]]]', '\HrController:remunerationlog')->setName('hrRemunerationlog')->add('\CrmMiddleware:isStaff');

$app->get('/hr/detail/{id:[0-9]+}/performance[/{month:[0-9]+}]', '\HrController:performance')->setName('hrDetailPerformance')->add('\CrmMiddleware:isStaff');
$app->get('/hr/detail/{id:[0-9]+}/candc', '\HrController:candc')->setName('hrDetailCandc')->add('\CrmMiddleware:isStaff');
$app->get('/hr/detail/{id:[0-9]+}/msg', '\HrController:msg')->setName('hrDetailMsg')->add('\CrmMiddleware:isStaff');

$app->get('/hr/form[/{id:[0-9]+}]', '\HrController:form')->setName('hrForm')->add('\CrmMiddleware:isStaff');
$app->post('/hr/save[/{id:[0-9]+}]', '\HrController:save')->setName('hrSaveform')->add('\CrmMiddleware:isStaff');

$app->get('/hr/search', '\HrController:searchform')->setName('hrSearchform')->add('\CrmMiddleware:isStaff');
$app->post('/hr/search', '\HrController:searchresult')->setName('hrSearchresult')->add('\CrmMiddleware:isStaff');

$app->get('/hr/getonlineJSON', '\HrController:getstaffJSON')->add('\CrmMiddleware:isStaff');

$app->get('/chat/getlogJSON', '\DesktopController:getChatLog')->add('\CrmMiddleware:isStaff');


//opportunity

$app->get('/opportunity[/{status:[0-9]+}[/{p:[0-9]+}]]', '\OpportunityController:index')->setName('opporIndex')->add('\CrmMiddleware:isStaff');
$app->get('/opportunity/detail/{id:[0-9]+}', '\OpportunityController:detail')->setName('opporDetail')->add('\CrmMiddleware:isStaff');
$app->post('/opportunity/do/{id:[0-9]+}', '\OpportunityController:savedo')->setName('opporDo')->add('\CrmMiddleware:isStaff');
$app->get('/opportunity/mine[/{status:[0-9]+}[/{p:[0-9]+}]]', '\OpportunityController:mine')->setName('opporMine')->add('\CrmMiddleware:isStaff');
$app->get('/opportunity/report[/{year:[0-9]+}]', '\OpportunityController:report')->setName('opporReport')->add('\CrmMiddleware:isStaff');

$app->get('/opportunity/search', '\OpportunityController:searchform')->setName('opporSearchform')->add('\CrmMiddleware:isStaff');
$app->post('/opportunity/search', '\OpportunityController:searchresult')->setName('opporSearchresult')->add('\CrmMiddleware:isStaff');

$app->get('/opportunity/form[/{id:[0-9]+}]', '\OpportunityController:form')->setName('opporForm')->add('\CrmMiddleware:isStaff');
$app->post('/opportunity/save[/{id:[0-9]+}]', '\OpportunityController:save')->setName('opporSaveform')->add('\CrmMiddleware:isStaff');


//executive
$app->get('/executive', '\ExecutiveController:index')->setName('executiveIndex')->add('\CrmMiddleware:isStaff');

$app->get('/executive/notice[/{p:[0-9]+}]', '\ExecutiveController:notice')->setName('executiveNotice')->add('\CrmMiddleware:isStaff');
$app->get('/executive/notice/detail/{id:[0-9]+}', '\ExecutiveController:noticedetail')->setName('executiveNoticeDetail')->add('\CrmMiddleware:isStaff');
$app->post('/executive/notice/save[/{id:[0-9]+}]', '\ExecutiveController:savenotice')->setName('executiveNoticeSave')->add('\CrmMiddleware:isStaff');
$app->post('/executive/worktime', '\ExecutiveController:worktime')->setName('executiveWorktime')->add('\CrmMiddleware:isStaff');
$app->get('/executive/worktime[/{year:[0-9]+}[/{month:[0-9]+}[/{day:[0-9]+}]]]', '\ExecutiveController:worktimelog')->setName('executiveWorktimeLog')->add('\CrmMiddleware:isStaff');
$app->get('/executive/mine[/{year:[0-9]+}[/{month:[0-9]+}[/{day:[0-9]+}]]]', '\ExecutiveController:minelog')->setName('executivemineLog')->add('\CrmMiddleware:isStaff');

$app->get('/executive/detail/{id:[0-9]+}', '\ExecutiveController:notdetail')->setName('executiveNotdetail')->add('\CrmMiddleware:isStaff');
$app->get('/executive/add', '\ExecutiveController:notadd')->setName('executiveNotadd')->add('\CrmMiddleware:isStaff');//加载添加也面
$app->post('/executive/insert', '\ExecutiveController:notinsert')->setName('executiveNotinsert')->add('\CrmMiddleware:isStaff');//添加外勤信息
$app->post('/executive/update', '\ExecutiveController:notupdate')->setName('executiveNotupdate')->add('\CrmMiddleware:isStaff');//修改外勤信息
$app->get('/executive/welfare', '\ExecutiveController:notselect')->setName('executiveNotwelfare')->add('\CrmMiddleware:isStaff');//节日福利列表
$app->get('/executive/jieadd', '\ExecutiveController:notjieadd')->setName('executiveNotjieadd')->add('\CrmMiddleware:isStaff');//跳转添加节日页面
$app->post('/executive/jieinsert', '\ExecutiveController:notjieinsert')->setName('executiveNotjieinsert')->add('\CrmMiddleware:isStaff');//提交添加节日信息
$app->get('/executive/jedit/{id:[0-9]+}', '\ExecutiveController:notjedit')->setName('executiveNotjedit')->add('\CrmMiddleware:isStaff');//查看节日详细信息
$app->post('/executive/jupdate', '\ExecutiveController:notjupdate')->setName('executiveNotjupdate')->add('\CrmMiddleware:isStaff');//修改节日信息


//finance
$app->get('/finance', '\MoneyController:index')->setName('financeIndex')->add('\CrmMiddleware:isStaff');

//complain
$app->get('/complain', '\ComplainController:index')->setName('complainIndex')->add('\CrmMiddleware:isStaff');

//operate
$app->get('/operate', '\OperateController:index')->setName('operateIndex')->add('\CrmMiddleware:isStaff');

//performance
$app->get('/performance', '\PerformanceController:index')->setName('performanceIndex')->add('\CrmMiddleware:isStaff');

$app->get('/ranking[/{month:[0-9]+}]', '\PerformanceController:ranking')->setName('rankingIndex')->add('\CrmMiddleware:isStaff');

//report
$app->get('/report', '\ReportController:index')->setName('reportIndex')->add('\CrmMiddleware:isStaff');

//setting
$app->get('/setting', '\SettingController:index')->setName('settingIndex')->add('\CrmMiddleware:isStaff');

//cms
$app->get('/cms', '\CmsController:index')->setName('cmsIndex')->add('\CrmMiddleware:isStaff');

//upload
$app->post('/upload', '\UploadController:upload')->add('\CrmMiddleware:isStaff');
$app->post('/uploadfile', '\UploadController:uploadfile')->add('\CrmMiddleware:isStaff');
$app->post('/uploadPic', '\UploadController:uploadPic')->add('\CrmMiddleware:isStaff');

//city-prov-area
$app->get('/prov', '\DesktopController:getprov');
$app->get('/city[/{pcode:[0-9]+}]', '\DesktopController:getcity');
$app->get('/area[/{pcode:[0-9]+}]', '\DesktopController:getarea');

$app->get('/noauthority', '\DesktopController:noauthority')->setName('errorNoauthority');
$app->get('/noId', '\DesktopController:noId')->setName('errorNoId');
